ActiveReports 12 Server Designer User Guide
Working with Filters
ActiveReports 12 Server Designer User Guide > Get Started with ActiveReports Web Designer > Working with Filters

You can set filters on a large set of data that has already been retrieved from the data source, and then use them with datasets or data regions to limit the information you want to display on your report. Normally you can filter your data using parameters in a query, but if your data source does not support parameters you can use filters. You can set filters on the following:

Each option of using a filter has its advantages. Normally, you use a dataset filter if you want to reduce data for the whole report in your dataset query to the server that stores data. Then you will use the filtered data throughout the report. For example, you want to create a report that shows sales for the last quarter in a year. Then in your report you will add a dataset that provides all sales orders for a year and create a dataset filter to get only data for the last quarter of the year's sales from the dataset.

You may also want to use a data region filter. Such filter does not reduce data available throughout the report. With the data region filter, you can show some data in one part of the report while showing the rest of the data in another part of the report. For example, you can create a report with two data regions, one data region (Table 1) displaying the last month's sales per day and the other data region (Table 2) displaying the summary data for the monthly sales. In this case, you can use the data without any filter in the summary data table (Table 2) but use a data region filter in the details table (Table 1) to reduce data just for the last month.

Note: Aggregate functions cannot be used in data region filters.

Filtering Operators

Filter Operator Description
And Select this logical operator if you want to choose data that matches each of the filter criteria. This operator works with 2 or more filter criteria.
Or Select this logical operator if you want to choose data that matches any of the filter criteria. This operator works with 2 or more filter criteria.
EqualTo Select this operator if you want to choose data for which the value on the left is equal to the value on the right.
NotEqualTo Select this operator if you want to choose data for which the value on the left is not equal to the value on the right.
GreaterThan Select this operator if you want to choose data for which the value on the left is greater than the value on the right.
GreaterThanOrEqualTo Select this operator if you want to choose data for which the value on the left is greater than or equal to the value on the right.
LessThan Select this operator if you want to choose data for which the value on the left is less than the value on the right.
LessThanOrEqualTo Select this operator if you want to choose data for which the value on the left is less than or equal to the value on the right.
In Select this operator if you want to choose items from the value on the left which are in the array of values on the right.
Between Select this operator if you want to choose items from the value on the left which fall between pair of values you specify on the right. This operator enables two Value boxes instead of one.
Contains Select this operator if you want to choose data for which the value on the left contains the value on the right.
DoesNotContain Select this operator if you want to choose data for which the value on the left does not contain the value on the right.
BeginsWith Select this operator if you want to choose data for which the value on the left begins with the value on the right.
DoesNotBeginWith Select this operator if you want to choose data for which the value on the left does not begin with the value on the right.

Let us apply filter to a report that looks similar to the following. We want to show only customers from one country, for example, from Australia.

Report without filter:

 

Report with filter:

 

This report is editable only by users with administrator role.

Apply filter to shared or embedded dataset

  1. From the top right corner of Web Designer, click the Data icon .
  2. Click Edit next to the data set you want to edit. The Edit dataset dialog appears.
  3. Go to the Filters property, click Show Items and then click Add Item. A filter is added.

  4. Click  to view the filter properties and set the properties as follows:
    Property Value
    Filter Expression =InStr(Fields.Item("Billing Country").Value, "Australia")
    Operator NotEqual
    Value 0

  5. Click OK

Apply filter to dataset from semantic model

  1. From the top right corner of Web Designer, click the Data icon .
  2. Click Edit next to the data set you want to edit. The Edit dataset smart dialog appears.
  3. Go to the Query Filter property, click Show Items.
  4. Click Set Filter. The Query Filter Editor appears.

  5. Set the properties as follows:
    Property Value
    Filter Expression Billing Country
    Operator Contains
    Value Australia
  6. Click OK.

    Note: As an advanced option, you can use a smart filter in semantic reports to create multiple filter groups with the AND/OR relation between them. Each filter group can have multiple filtering criteria.
    1. You can add a Parent filter group by clicking the Add Parent button in the Query Filter property.
    2. You can create a Child filter group for Parent filter groups by setting AND/OR functions for the filter criterion.

Apply filter to data region

  1. Select Table data region or Chart data region.
  2. Go to Filters property, click Show Items. and then click Add Item. A filter is added.

  3. Click  to view the filter properties and set the properties as follows:
    Property Value
    Filter Expression =InStr(Fields.Item("Billing Country").Value, "Australia")
    Operator NotEqual
    Value 0

    The filters should look as shown:

Apply filter to a group in a data region

  1. Select Table data region.
  2. Select Table_Details_Group.
  3. Go to Filters property, click Show Items. and then click Add Item. A filter is added.

  4. Click  to view the filter properties and set the properties as follows:
    Property Value
    Filter Expression =InStr(Fields.Item("Billing Country").Value, "Australia")
    Operator NotEqual
    Value 0